package com.zmzncs.lmtc.module.order.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zmzncs.lmtc.module.order.pojo.orderreserve.ParkReserveRecord;
import com.zmzncs.lmtc.module.order.pojo.orderreserve.ParkReserveRecordDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 预约记录表 Mapper 接口
 * </p>
 *
 * @author 任建波
 * @since 2020-12-14
 */
@Repository
@Mapper
public interface ParkReserveRecordDao extends BaseMapper<ParkReserveRecord> {

      /** 查询预约记录表分页数据 */
      IPage<ParkReserveRecordDTO> list(Page page, @Param("customerId") Long customerId, @Param("status") String status);
      /** 查询预约记录 */
      List<ParkReserveRecordDTO> list(@Param("customerId") Long customerId, @Param("status") Integer status);
      /** 根据id查询数据 */
      ParkReserveRecordDTO getById(Long id);

      /**查询预约记录信息 */
      IPage<ParkReserveRecordDTO> getReserveRecord(Page page, @Param("customerId") Long customerId);

      /**查询是否需要更新状态预约记录 */
      ParkReserveRecordDTO getRecordByCarNumber(@Param("carNumber") String carNumber, @Param("parkId") Long parkId, @Param("inTime") Date inTime);

      /**根据预约状态和停车场id查询*/
      List<ParkReserveRecordDTO> getByParkIdStatus(@Param("customerId") Long customerId, @Param("parkId") Long parkId, @Param("statusList") Integer[] statusList);

      /**根据tradeNo查询*/
      ParkReserveRecordDTO getByTradeNo(String tradeNo);

      /** 查询停车场*天预约成功的预约记录*/
      List<ParkReserveRecordDTO>getReserveRecordByReserveDate(@Param("parkId") Long parkId, @Param("reserveDate") Date reserveDate);
}
